package com.qikux.dao;

import com.qikux.entity.User;
import com.qikux.entity.UserInfo;
import com.qikux.entity.UserScore;
import com.qikux.vo.Page;

import java.util.List;
import java.util.Map;

public interface UserDao {

    User findUserByTel(String tel);

    User findUserByEmail(String email);

    int saveUser(User user);

    int saveUserInfo(UserInfo userInfo);

    User findUserById(Long userId);

    void updateStatus(long userId, int i);

    Map<String, Object> findScoreConfigByAction(String action);

    void saveUserScore(UserScore userScore);

    UserInfo findUserInfoByUserId(Long id);

    void updatePassWord(Long id, String newPassWord);

    List<Map<String, Object>> findUserStaticsScore(Long userId);

    List<Map<String, Object>> findUserScoreByUserId(Long userId, Page<Map<String,Object>> pageBean);

    int findUserScoreCountByUserId(Long id);

    void updateNickNameByUserId(String nickName, Long id);

    void updateSexByUserId(String sex, Long id);

    void updatePhoto(UserInfo info);

    void updateEmail(Long id, String newEmail);

    void initePassword(Long id);

    List<Map<String, Object>> findUserAttention(Long userId,Page<Map<String, Object>> pageBean);

    List<Map<String, Object>> findUserFenNumById(Long id);

    List<Map<String, Object>> findUserFenNumById2(Long userId);

    int uploadStatusByUid(Long uid);

    List<Map<String, Object>> queryCollectResourceByUseId(Long id,Page<Map<String,Object>> pageBean);

    int queryCollectResourceCountByUseId(Long id);

    List<Map<String, Object>> queryCollectResByUseId(Long id,Page<Map<String,Object>> pageBean);

    int queryCollectResCountByUseId(Long id);

    Map<String, Object> qureyIdByPid(Long pid);


    int findUserAttentionCountByUserId(Long userId);
    // 通过Uid给用户添加关注
    int addAttentionByUid(Long userId, Long uid);

    int deleteAttentionByUid(Long userId, Long uid);

    Map<String, Object> findAttentionStatusById(Long userId, Long rId);
    // 通过两个id 查找是否再关注表中
    Map<String, Object> findAttentionByUserIdAndRid(Long userId, Long rId);
    // 通过两个id将一个用户放入关注表，默认为0
    int addAttentionByUidAndRid(Long userId, Long rId);

    List<Map<String, Object>> isAttentionResUserId(Long id, Long resUserId);
}
